package cn.juque.jdfsystem.task;

import cn.juque.jdfsystem.cache.PlatformInfoCache;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>PlatformRefreshTask</li>
 * </ul>
 * @date 2023-01-13 16:23:03
 **/
@Service("platformRefreshTask")
public class PlatformRefreshTask extends AbstractTask{

    @Resource
    private PlatformInfoCache platformInfoCache;

    /**
     * 任务逻辑
     *
     * @param args 参数
     */
    @Override
    public void execute(String[] args) {
        this.platformInfoCache.refresh();
    }

    /**
     * 设置随机休眠等待最大时长 单位：秒
     *
     * @return 秒
     */
    @Override
    protected Integer initSleepTimes() {
        return 4;
    }

    @Override
    protected String getTaskName() {
        return "PlatformRefreshTask";
    }
}
